********************************************************************************************************
* Table SI.4. Demographic characteristics of Israeli respondents who report knowing someone who was victim of an incident of violence related to the conflict with the Palestinians and those who did not know any victim
*********************************************************************************************************
frame create victimization
frame change victimization 

* Load the data
use "$rootfolder\Data\Israelis_ranking_data.dta"

gen EV = (count_people_know>0 & count_people_know<.)

* NOTE: This piece of analysis needs to be done at the individual level [so keep if unique]
* Table SI.4. Assembled manually from the following results 
preserve 
egen unique = tag(participantcode)
keep if unique
keep if card_ranking_today_cardgam > 240 & repsample==1  | card_ranking_today_cardgam > 240 & consent_ipanel_project==1

* How many report someone being a victim?
tab EV 
tab EV count_died  /* (72+8+2+2+1)/199=42.7%    */


tab consent_district, gen(district)
table EV, statistic(mean consent_gender demographics_age consent_ipanel_project )
prtest consent_gender, by(EV)

tabstat demographics_age, stats(mean sd p50 min max) by(EV)
ttest demographics_age, by(EV) unequal
/*twoway (histogram demographics_age if EV==1, color(blue%50) lcolor(blue))  ///
	   (histogram demographics_age if EV==0, fcolor(none) lcolor(black)), ///
	   legend(order(1 "Exposed to Violence" 2 "Not Exposed to Violence" )) ///
	   xtitle("Years of age") xtick(20(10)90) xlabel(20(10)90)
*/

tab consent_district EV, col

reg EV demographics_gender demographics_age i.consent_district, robust

restore 
